package com.dstz.bpm.api.constant;

import com.dstz.base.api.exception.BusinessException;
import com.dstz.bpm.api.exception.BpmStatusCode;

public enum ActionType {
   DRAFT("draft", "保存草稿", "instanceSaveActionHandler"),
   START("start", "启动", "instanceStartActionHandler"),
   AGREE("agree", "同意", "taskAgreeActionHandler"),
   SIGNAGREE("signAgree", "会签同意", "taskSignAgreeActionHandler"),
   SAVE("save", "保存", "taskSaveActionHandler"),
   OPPOSE("oppose", "反对", "taskOpposeActionHandler"),
   SIGNOPPOSE("signOppose", "会签反对", "taskSignOpposeActionHandler"),
   REJECT("reject", "驳回", "taskRejectActionHandler"),
   REJECT2START("reject2Start", "驳回发起人", "taskReject2StartActionHandler"),
   RECOVER("recover", "撤销", "null"),
   DISPENDSE("dispense", "分发", "null"),
   TASKOPINION("taskOpinion", "审批历史", "instanceTaskOpinionActionHandler"),
   FLOWIMAGE("flowImage", "流程图", "instanceImageActionHandler"),
   PRINT("print", "打印", "instancePrintActionHandler"),
   MANUALEND("manualEnd", "人工终止", "instanceManualEndActionHandler"),
   LOCK("lock", "锁定", "taskLockActionHandler"),
   UNLOCK("unlock", "解锁", "taskUnlockActionHandler"),
   TURN("turn", "转办", "taskTurnActionHandler"),
   REMINDER("reminder", "催办", "instanceReminderActionHandler"),
   WITHDRAW("withdraw", "撤回", "instanceWithdrawActionHandler"),
   ADDSIGN("addSign", "加签", "addSignActionHandler"),
   CREATE("create", "创建时", "null"),
   END("end", "流程结束", "null"),
   TASKCANCELLED("taskCancelled", "任务取消", "null");

   private String key = "";
   private String name = "";
   private String beanId = "";

   private ActionType(String key, String name, String beanId) {
      this.key = key;
      this.name = name;
      this.beanId = beanId;
   }

   public String getKey() {
      return this.key;
   }

   public void setKey(String key) {
      this.key = key;
   }

   public String getName() {
      return this.name;
   }

   public String getBeanId() {
      return this.beanId;
   }

   public void setName(String value) {
      this.name = value;
   }

   public String toString() {
      return this.key;
   }

   public static ActionType fromKey(String key) {
      ActionType[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         ActionType c = var1[var3];
         if (c.getKey().equalsIgnoreCase(key)) {
            return c;
         }
      }

      throw new BusinessException(BpmStatusCode.NO_TASK_ACTION);
   }
}
